<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
        
	'id'=>'user-form',
	'enableAjaxValidation'=>true,
        'enableClientValidation'=>true,
        'htmlOptions'=>array('enctype'=>'multipart/form-data'),
));

// import the extension
Yii::import('ext.jqPrettyPhoto');

$options = array(
    'slideshow'=>5000,
    'autoplay_slideshow'=>false,
    'show_title'=>false
);
// call addPretty static function
jqPrettyPhoto::addPretty('.gallery a',jqPrettyPhoto::PRETTY_SINGLE,jqPrettyPhoto::THEME_FACEBOOK, $options);

?>


	<p class="note">Các trường có ( <span class="required">*</span> ) là bắt buộc điền thông tin.</p>

	<?php //echo $form->errorSummary($model); ?>
         <?php if($model->isNewRecord) : ?>
        <div class="row">
               
		<?php echo $form->labelEx($model,'level'); ?>
                <?php echo $form->dropDownList($model,'level',User::getTypeUser()) ?>
		<?php echo $form->error($model,'level'); ?>
                
	</div>
        <?php endif;?>
        <div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>50,'maxlength'=>70)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>0,'maxlength'=>16)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>
        
        <div class="row">
		<?php echo $form->labelEx($model,'avatar'); ?>
		<?php echo CHtml::activeFileField($model,'avatar'); ?>
		<?php echo $form->error($model,'avatar'); ?>
	</div>
        <?php if(!$model->isNewRecord) : ?>
        
        <div class="gallery">
            <?php echo CHtml::link(CHtml::image($avatarThumbnail),$avatar); ?>
        </div>
        <?php endif; ?>
	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>	
	<div class="row">
		<?php echo $form->labelEx($model,'full_name'); ?>
		<?php echo $form->textField($model,'full_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'full_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'mobile'); ?>
		<?php echo $form->textField($model,'mobile',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'mobile'); ?>
	</div>	
        <div class="row">
		<?php echo $form->labelEx($model,'province'); ?>
		<?php echo $form->dropDownList($model,'province',array(''=>'Chon tinh','0'=>'Ha Noi','1'=>'Hai Duong')); ?>
		<?php echo $form->error($model,'province'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textField($model,'address',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'address'); ?>
	</div>        
        <div class="row">
		<?php echo $form->labelEx($model,'birthday'); ?>
		<?php echo $form->textField($model,'birthday'); ?>
		<?php echo $form->error($model,'birthday'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($model,'gender'); ?>
		<?php echo $form->dropDownList($model,'gender',array('1'=>'Nam','0'=>'Nữ')); ?>
		<?php echo $form->error($model,'gender'); ?>
	</div>

	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Thêm mới' : 'Lưu'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->